class Solution {
public:
    int maxArea(vector<int>& height) {
        int left = 0, right = height.size() - 1, ret = 0;
        while(left < right)
        {
            int v = (right - left) * min(height[left], height[right]);
            ret = max(v, ret);
            if(height[left] < height[right]) // 哪个小哪个就往中间移动
            {
                ++left;
            }
            else
            {
                --right;
            }
        }
        return ret;
    }
};